package com.zp.base.admin.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.zp.base.admin.common.annotation.AddGroup;
import com.zp.base.admin.common.annotation.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 
 * 
 * @author zhangpeng
 * @email zhangpeng@aliyun.com
 * @date 2021-02-28 11:15:56
 */
@Data
@TableName("zp_menu")
public class MenuEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	@TableId
	@NotNull(message = "修改时菜单ID不能为空", groups = {UpdateGroup.class})
	@Null(message = "添加时菜单ID为空", groups = {AddGroup.class})
	private Long id;
	/**
	 * 
	 */
	private Date createTime;
	/**
	 * 
	 */
	private Date updateTime;
	/**
	 * 菜单名称
	 */
	@NotEmpty(message = "菜单名称不能为空", groups = {UpdateGroup.class, AddGroup.class})
	private String name;
	/**
	 * 菜单路径
	 */
	private String url;
	/**
	 * 菜单图标
	 */
	@NotEmpty(message = "菜单图标不能为空", groups = {UpdateGroup.class, AddGroup.class})
	private String icon;
	/**
	 * 排序
	 */
	@NotNull(message = "菜单排序不能为空", groups = {UpdateGroup.class, AddGroup.class})
	private Integer sort;
	/**
	 * 父菜单ID
	 */
	private Long parentId;
	/**
	 * 该分类的所有子分类
	 */
	@TableField(exist = false) //表示当前属性不是数据库的字段
	private List<MenuEntity> childrenMenus;
	/**
	 * 是否是按钮
	 */
	private Boolean isBitton;
	/**
	 * 是否展示
	 */
	private Boolean isShow;
	/**
	 * 菜单资源权限标志
	 */
	@NotEmpty(message = "菜单权限不能为空", groups = {UpdateGroup.class, AddGroup.class})
	private String menuPermission;
}
